package com.goat.game;

import com.goat.controller.GameListener4Key;
import com.goat.controller.GameThread;
import com.goat.view.GameJFrame;
import com.goat.view.MainJPanel;

public class GameStart {
    public static void main(String[] args) {
        //1.创建窗口
        GameJFrame gameJFrame = new GameJFrame();

        //2.为窗口<注入> 监听(Listener)、画板(JPanel)、线程
        //这里只是注入，start()才将它们加入窗口
        gameJFrame.setjPanel(new MainJPanel());
        gameJFrame.setKeyListener(new GameListener4Key());
        gameJFrame.setThread(new GameThread());

        //肯定是最后才启动的
        gameJFrame.start();
    }
}
